﻿CREATE TABLE [Mapping].[TargetKey]
(
	[Id] INT NOT NULL PRIMARY KEY NONCLUSTERED IDENTITY, 
	[Category] INT NULL,
  [KeyValue] NVARCHAR(20) NOT NULL, 
	[KeyAlternateValue] SQL_VARIANT NULL,
  [Description] NVARCHAR(200) NULL, 
  CONSTRAINT [FK_TargetKey_Category] FOREIGN KEY ([Category]) REFERENCES [Mapping].[Category]([Id]) ON DELETE CASCADE
)

GO

CREATE UNIQUE CLUSTERED INDEX [IX_TargetKey_Unique] ON [Mapping].[TargetKey] ([Category], [KeyValue])
